package com.example.note;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.support.v4.view.PagerAdapter;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;

public class StartMainActivity extends Activity {

	protected static final String TAG = "StartMainActivity";
	private int[] mImgIds;
	private MyJazzyViewPager mViewPager;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.start_main);

		mImgIds = new int[] {R.drawable.shiguanshouye2, R.drawable.shiguangshouye1, R.drawable.shiguangshouye3,
			};
		mViewPager = (MyJazzyViewPager) findViewById(R.id.id_viewPager);
		mViewPager.setAdapter(new PagerAdapter() {

			@Override
			public boolean isViewFromObject(View arg0, Object arg1) {
				return arg0 == arg1;
			}

			@Override
			public void destroyItem(ViewGroup container, int position,
					Object object) {
				container.removeView((View) object);
			}

			@Override
			public Object instantiateItem(ViewGroup container, int position) {
				ImageView imageView = new ImageView(StartMainActivity.this);
				imageView.setImageResource(mImgIds[position]);
				imageView.setScaleType(ScaleType.CENTER_CROP);
				container.addView(imageView);
				mViewPager.setObjectForPosition(imageView, position);
				return imageView;
			}

			@Override
			public int getCount() {
				return mImgIds.length;
				
			}
		});


	
	new Handler().postDelayed(new Runnable()  
    {  
        public void run()  
        {  
            Intent intent = new Intent(StartMainActivity.this, MainActivity.class);  
            startActivity(intent);  
            StartMainActivity.this.finish();  

        }  
    }, 8000);  
	
	
	
}	}
	
	
	